package com.jx.lcs.productorder.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jx.lcs.product.entity.ProductInfo;
import com.jx.lcs.user.entity.UserInfo;

/** 
 * 产品预约
 * @author JiaYY 
 * @date 2015年7月15日
 */

@Entity
@Table(name = "tb_product_order")
@DynamicInsert
@DynamicUpdate
public class ProductOrder implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "ID", unique = true, nullable = false)
	private String id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UID", referencedColumnName="UID")
	@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 
	private UserInfo user;
	
	@Column(name = "CID")
	private String cid;
	
	@Column(name = "CNAME")
	private String cname;
	
	@Column(name = "CID_CARD_NO")
	private String cidCardNo;
	
	@Column(name = "CTEL")
	private String ctel;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PCODE", referencedColumnName="PCODE")
	@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 
	private ProductInfo productInfo;
	
	@Column(name = "INVESTMONEY")
	private BigDecimal investMoney;
	
	@Column(name = "STATUS")
	private String status;
	
	@Column(name = "SOURCE")
	private String source;
	
	@Column(name = "ORDERTIME")
	@Temporal(TemporalType.TIMESTAMP)
	private Date orderTime;
	
	@Column(name = "CONFIRMTIME")
	@Temporal(TemporalType.TIMESTAMP)
	private Date confirmTime;

	public Date getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(Date confirmTime) {
		this.confirmTime = confirmTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public UserInfo getUser() {
		return user;
	}

	public void setUser(UserInfo user) {
		this.user = user;
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getCidCardNo() {
		return cidCardNo;
	}

	public void setCidCardNo(String cidCardNo) {
		this.cidCardNo = cidCardNo;
	}

	public String getCtel() {
		return ctel;
	}

	public void setCtel(String ctel) {
		this.ctel = ctel;
	}

	public ProductInfo getProductInfo() {
		return productInfo;
	}

	public void setProductInfo(ProductInfo productInfo) {
		this.productInfo = productInfo;
	}

	public BigDecimal getInvestMoney() {
		return investMoney;
	}

	public void setInvestMoney(BigDecimal investMoney) {
		this.investMoney = investMoney;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
}
